Fix: Don't create new ContractResolver on every serialization/deserialization#609
Conversation
|
Thanks for this one. I am changing all projects in this repo over to using GitHub actions and will release it once that is done. |
|
wow thanks for this fix finally. let me know once it is published any pre release or so. I will test it immediately :) |
|
I'm changing all the rxui builds to use GitHub actions when that is done for akavache will do a release |
|
does 7.1.1 include this fix? because i have just tested and still slow |
|
It's in. https://github.com/reactiveui/Akavache/releases/tag/7.1.1 Those release notes are auto generated these days. I am hoping to give akavache some love this week so will do some more stuff to improve bulk pushes. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
Bug fix: #587
What is the current behavior?
For every single object that is serialized/deserialized, a new ContractResolver is created. This is a VERY expensive, reflection-heavy operation. Newtonsoft.Json is very clear that you should create and reuse a single ContractResolver.
What is the new behavior?
What might this PR break?
I believe this is low-risk.
Please check if the PR fulfills these requirements
Other information:
If anyone has an idea of how to test this, please let me know. It is an implementation detail of a private method. As a part of this, I also fixed a couple tests that didn't work on unix-based systems.
Note that this improves performance of bulk operations by up to 40x on my Mac, iOS, and Android devices.